package com.yequan.leetcode.sort;

/**
 * @author : Administrator
 * @date : 2020/3/31
 */
public class BubbleSort {

    public static void main(String[] args) {

    }


    public int[] sortArray(int[] nums) {
        if (nums == null || nums.length == 0) {
            return nums;
        }
        for (int i = 0; i < nums.length; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] > nums[j]) {
                    int temp = nums[i];
                    nums[i] = nums[j];
                    nums[j] = temp;
                }
            }
        }
        return nums;
    }

}
